package net.vinote.smart.platform.service.handler;

import net.vinote.smart.platform.module.database.bo.BizObject;
import net.vinote.smart.platform.service.dw.handler.CommonHandler;
import net.vinote.smart.platform.service.dw.handler.HandlerPerimissionAnnotation;
import net.vinote.smart.platform.service.util.Permission;
import net.vinote.smart.platform.service.util.Permission.PermissionEnum;

@HandlerPerimissionAnnotation(
		insert = @Permission(PermissionEnum.SMART_LAYOUT_ITEM_INSERT),
		update = @Permission(PermissionEnum.SMART_LAYOUT_ITEM_UPDATE),
		delete = @Permission(PermissionEnum.SMART_LAYOUT_ITEM_DELETE),
		query = @Permission(PermissionEnum.SMART_LAYOUT_ITEM_QUERY))
public class LayoutItemHandler extends CommonHandler {
	@Override
	public void initDisplayForAdd(BizObject bo) {
		String layoutID = request.getParameter("layoutID");
		setDefaultValue("LAYOUTID", layoutID);
	}

	@Override
	public void initDisplayForEdit(BizObject bo) {
		setReadOnly("ItemNo", true);
	}
}
